package com.samuel.demo.service;

import com.samuel.demo.persist.entity.Book;
import com.samuel.demo.persist.mapper.BookMapper;
import com.samuel.demo.tools.PrintTools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class  BookRepository{

    @Autowired
    private BookMapper bookMapper;


    public Boolean inserBook(int id,String name,String desc) {

        PrintTools.print("進入业务模块，处理插入书籍");
         Book book =new Book();
         book.setBookId(id);
         book.setBookName(name);
         book.setDesc(desc);
        return bookMapper.insert(book)==1;
    }
}
